package com.smart.service;

import com.smart.domain.Express;
import com.smart.infer.userInt;
import com.smart.infer.userPubInt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class selectService {
    @Autowired
    private userPubInt mapper;
    @Autowired
    private userInt map;

    public int findscore(String userid){
        int score=map.findScore(userid);
        return score;
    }
    public void updateScoreDown(String userid){
        map.updateScoreDown(userid);
    }
    /*
    public List<Express> selectCN(){
        List<Express> list= mapper.findByEsc("中通");
        List<Express> list2= mapper.findByEsc("圆通");
        List<Express> list3= mapper.findByEsc("韵达");
        List<Express> list4= mapper.findByEsc("天天");
        List<Express> L=new ArrayList<>();
        L.addAll(list);L.addAll(list2);L.addAll(list3);L.addAll(list4);
        return L;

    }
    public List<Express> selectYZ(){
        List<Express> listYZ=mapper.findByEsc("邮政");
        return listYZ;
    }
    public List<Express> selectJD(){
        List<Express> listJD=mapper.findByEsc("京东");
        return listJD;
    }
    public List<Express> selectTM(){
        List<Express> listTM=mapper.findByEsc("天猫");
        return listTM;
    }
    public List<Express> selectST(){
        List<Express> listST=mapper.findByEsc("申通");
        return listST;
    }
    public List<Express> selectBS(){
        List<Express> listBS=mapper.findByEsc("百世");
        return listBS;
    }*/

    public List selectMy(String username){
        List list=mapper.findAllByUser(username);
        return list;
    }

    public List selectMyLeader(String userid){
        List list2=mapper.findAllByUser2(userid);
        return list2;
    }

}
